package org.ddr.member.dao;

import java.util.ArrayList;
import java.util.List;

import org.ddr.member.MemberVO;

public class MemberDAOImpl implements MemberDAO {
	MemberVO vo;
	
	private static final MemberDAOImpl instance;

	static {
		instance = new MemberDAOImpl();
	}

	private MemberDAOImpl() {
		;
	}

	public static MemberDAOImpl getInstance() {
		return instance;
	}

	@Override
	public MemberVO getUser(final String userId, final String pw) throws Exception {

		
		new MemAbstractExecutor() {

			@Override
			protected void execute() throws Exception {
				StringBuffer sql = new StringBuffer();
				sql.append(" SELECT * ");
				sql.append(" FROM TBL_MEMBER ");
				sql.append(" WHERE userid = ? AND pw = ? ");
				
				pstmt = con.prepareStatement(sql.toString());
				pstmt.setString(1, userId);
				pstmt.setString(2, pw);
				
				rs = pstmt.executeQuery();

				rs.next();

				vo = new MemberVO(rs.getString(1), rs.getString(2), rs
						.getString(3), rs.getInt(4), rs.getString(5));

			}
		}.doJob();
		return vo;
	}

	@Override
	public void update(MemberVO vo) throws Exception {
		
		new MemAbstractExecutor() {
			
			@Override
			protected void execute() throws Exception {
				
			}
		};
		
	}

}
